package com.wct.demo;

import com.github.jsonzou.jmockdata.JMockData;
import com.github.jsonzou.jmockdata.MockConfig;
import com.wct.demo.gui.LocalDateTimeMock;

import java.time.LocalDateTime;

/**
 * @author WEI (Email:changtan20000@163.com)
 * @description
 * @date: 2019/12/18 22:07
 */
public class MyMockTask {

    private static MockConfig mockConfig;

    static {
        mockConfig = new MockConfig()
                // 工号
                .subConfig(BankTask.class, "id")
                .intRange(1, 999999)
                // 业务
                .subConfig(BankTask.class, "type")
                .stringSeed("存款", "取款", "挂失", "还贷", "开户", "其他")
                .sizeRange(1, 1)
                // 窗口
                .subConfig(BankTask.class, "processWindows")
                .stringSeed("1", "2", "3", "4")
                .sizeRange(1, 1)
                .globalConfig();

        mockConfig.registerMocker(new LocalDateTimeMock(), LocalDateTime.class);
    }

    public static BankTask mock() {
        return JMockData.mock(BankTask.class, mockConfig);
    }
}
